package com.lzw.blog.admin.controller;

import com.lzw.blog.admin.model.params.PageParam;
import com.lzw.blog.admin.service.CommentsService;
import com.lzw.blog.admin.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("admin/comments")
public class CommentsController {

    @Autowired
    private CommentsService commentsService;

    @PostMapping("commentsList")
    public Result listComments(@RequestBody PageParam pageParam) {
        return  commentsService.listComment(pageParam);
    }

    @GetMapping("delete/{id}")
    public Result deleteComment(@PathVariable("id") Long id) {
        return commentsService.delete(id);
    }
}
